package com.ld.security.common.mybatis.util;

import com.ld.security.common.mybatis.base.entity.ESwitchEntity;
import com.ld.security.common.mybatis.base.po.PagePo;
import com.ld.security.common.mybatis.base.service.IProxyService;
import com.ld.security.common.mybatis.base.vo.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class JdbcUtil {

   static IProxyService iProxyService;

    public static Object proxyOpenSwitch(ESwitchEntity obj){
        return iProxyService.proxyOpenSwitch(obj);
    }

   public static Object proxyQuery(Object obj){
        return iProxyService.proxyQuery(obj);
    }


    public static Object proxySave(Object obj){
        return iProxyService.proxySave(obj);
    }


    public static Object proxyRemove(Object obj){
        return iProxyService.proxyRemove(obj);
    }


    public static Object proxyLabel(Object obj){
        return iProxyService.proxyLabel(obj);
    }

    public static <E> PageVo<E> page(PagePo<E> po){
        return iProxyService.page(po);
    }
    public static <E> List<E> all(E po){
        return iProxyService.all(po);
    }


    @Autowired
    public void setiProxyService(IProxyService iProxyService) {
        JdbcUtil.iProxyService = iProxyService;
    }
}
